package com.ray.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.ray.boot.dao.master.UserMapper;
import com.ray.boot.domain.UserDO;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * HelloController.java created at 2017年8月8日 下午1:11:20
 * @author Ray [email:rayinhangzhou@hotmail.com]
 * Revision History
 * Date            Programmer                   Notes
 * ----------------------------------------------------------
 **/

@Slf4j
@RestController
@EnableAutoConfiguration
public class HelloController {
	@Autowired
	private UserMapper userMapper;
	
	@RequestMapping("/sayHello")
	public String sayHello(@RequestParam String name) {
		return "hello:"+name;
	}
	
	@RequestMapping("/user")
	public UserDO getUser(@RequestParam String account) {
		log.info("message logback------->");
		return userMapper.getUserByAccount(account);
	}
	
}
